module.exports = function (grunt) {
  // 项目配置
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    uglify: {
      toast: {
        src: 'src/js/toast.js',
        dest: 'dist/js/toast.min.js'
      }
    },
    cssmin: {
      options: {
        keepSpecialComments: 0
      },
      toast: {
        files: {
          'dist/css/toast.min.css': ["src/css/toast.css","src/css/font.css"]
        }
      }
    },
    less: {
      toast: {
        options: {
          paths: ['dist/css']
        },
        files: {
          'src/css/toast.css': 'src/less/toast.less'
        }
      },
      font: {
        files: {
          'src/css/font.css': 'src/less/font_icon.less'
        }
      }
    }
  });
  // 加载提供"uglify"任务的插件
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  // 默认任务
  grunt.registerTask('default', ['uglify']);
  grunt.registerTask('toast', ['less:toast',"less:font",'cssmin:toast']);
}
